home *** CD-ROM | disk | FTP | other *** search
- Path: longwood.cs.ucf.edu!not-for-mail
- From: stevens@longwood.cs.ucf.edu (John Stevens)
- Newsgroups: comp.lang.c++
- Subject: Re: HELP ! => Problem compiling STL classes in Visual C++ 4.1.
- Date: 15 Apr 1996 10:08:25 -0400
- Organization: University of Central Florida
- Message-ID: <4ktl8p$bc2@longwood.cs.ucf.edu>
- References: <4kh12t$rs0@newsbf02.news.aol.com> <4khb6m$o5e@druid.borland.com>
- NNTP-Posting-Host: longwood.cs.ucf.edu
- X-Newsreader: TIN [version 1.2 PL2]
-
- Pete Becker (pete@borland.com) wrote:
- : In article <4kh12t$rs0@newsbf02.news.aol.com>, haris1@aol.com says...
- : >
- : >I have problem compiling the following STL program
- : >
- : >namespace std
- : >{
- : >#include <Vector.h>
- : >#include <Algo.h>
- : >}
- : >
- : >
- : >main ()
- : >{
- : > std::vector <int> v;
- : >
- : > v[0] = 1; v [1]=2; v[2]=3;
- : >}
- : >
- : >I am getting an error.
- : >"c:\msdev\stl\defalloc.h(124) : error C2660: 'new' :
- : > function does not take 2 parameters"
- : >
- : >I am using Visual C++ 4.1 under Window NT. I would appreciate if
- : >anybody could tell me how to resolve this problem. Apparently it looks
- : >like there is no overloaded 'new' operator defined in this STL files.
-
- : No, there isn't and there shouldn't be. Whoever advised you to add that
- : namespace declaration around the #include directives gave you truly bad advice.
- : You can't stick namespaces in from the outside. The headers must be written
- : with namespaces in mind. Whoever it was, put them on your list of people to
- : never ask for advice from. They don't know what they're talking about.
- [snip]
-
- Actually, it was advised by Microsoft... Oh. Enough said.
-
- The namespace declaration works, but you must include that header with 'new'
- in it explicitly before the namespace declaration and you must #define
- something which I can't remember (SORRY!) and you must modify the STL
- headers to reflect the namespace. It will work _mostly_. Unfortunately I
- deleted my source when I switched to Rogue Wave.
-
- Hope it helps some, anyway,
- John S.
-
- P.S. There are others which I corresponded with while I was fighting this.
- Please help!
-